package cn.iocoder.yudao.module.resource.convert;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.resource.controller.admin.advertisement.vo.ResourceAdvertisementRespVO;
import cn.iocoder.yudao.module.resource.dal.dataobject.advertisement.ResourceAdvertisementDO;
import org.mapstruct.Mapper;
import org.mapstruct.factory.Mappers;

@Mapper
public interface ResourceAdvertisementConvert {

    ResourceAdvertisementConvert INSTANCE = Mappers.getMapper(ResourceAdvertisementConvert.class);

    default ResourceAdvertisementRespVO convert(ResourceAdvertisementDO bean) {
        return BeanUtils.toBean(bean, ResourceAdvertisementRespVO.class);
    }

    default PageResult<ResourceAdvertisementRespVO> convertPage(PageResult<ResourceAdvertisementDO> page) {
        return BeanUtils.toBean(page, ResourceAdvertisementRespVO.class);
    }

}
